Api endpoint for image crops#4743
Conversation
andrew-nowak
left a comment
There was a problem hiding this comment.
lgtm!
In the future we could look to replace the clientside constants https://github.com/guardian/grid/blob/main/kahuna/public/js/util/constants/cropOptions.js with a lookup to this new endpoint, which would allow different deployers of the grid to more easily configure different "supported" ratios
| import play.api.mvc.{BaseController, ControllerComponents} | ||
|
|
||
| class ConfigurationController(override val controllerComponents: ControllerComponents) extends BaseController { | ||
| def cropVariations = Action { _ => Ok(Json.toJson(CropOption.supported)) } |
There was a problem hiding this comment.
I think it's worth a brief comment that this is intentionally without auth, for future travellers who might think it was an oversight and attempt to correct
There was a problem hiding this comment.
Yeah sounds good 👍
|
Seen on image-loader, leases, usage, kahuna (merged by @lindseydew 10 minutes ago) Please check your changes! |
|
Seen on collections, thrall, media-api (merged by @lindseydew 10 minutes and 11 seconds ago) Please check your changes! |
|
Seen on cropper, auth, metadata-editor (merged by @lindseydew 12 minutes and 17 seconds ago) Please check your changes! |
What does this change?
This makes the crop options that grid supports available as an API endpoint so that the media atom maker service can use this to ascertain if a specific crop is already supported in grid, so if another one is needed
How should a reviewer test this change?
How can success be measured?
Who should look at this?
Tested? Documented?